package luanvan.app.foodnote.library;

import java.util.ArrayList;

import android.location.Location;

public class AddressFromLatLng {
    
    private HttpRetriever http;
    
    private ArrayList<String> listAddresses;
    private String address1;
    private String address2;
    private String address3;
    private String address4;
    private String address5;
	
    private String fullAddress;
	
	
	public AddressFromLatLng(Location location){
		http = new HttpRetriever();
		http.getAddressFromGPSData(location.getLatitude(), location.getLongitude());
		address1 = HttpRetriever.getAddress1();
		address2 = HttpRetriever.getAddress2();
		address3 = HttpRetriever.getCounty();
		address4 = HttpRetriever.getState();
		address5 = HttpRetriever.getCountry();
			
		//cities = address4;
		
		fullAddress = address1 + ", " + address2 + ", " + address3 + ", " + address4;
		
		listAddresses = new ArrayList<String>();
		listAddresses.add(fullAddress);
		listAddresses.add(address2 + ", " + address3 + ", " + address4);
		listAddresses.add(address3 + ", " + address4);
		listAddresses.add(address4);
		listAddresses.add(address5);
	}
	
	
	
	//String cities = "";
	
	public ArrayList<String> listAddress(){
		return listAddresses;
	}
	
	public String Address(){
		return fullAddress;
	}
	public String Address1(){
		return address1;
	}
	public String Address2(){
		return address2;
	}
	public String Address3(){
		return address3;
	}
	public String Address4(){
		return address4;
	}
	public String Address5(){
		return address5;
	}
}
